import request from '@/utils/request'
import apis from './'

export function getMemberList (parameter) {
  return request({
    url: apis.MemberList,
    method: 'get',
    params: parameter
  })
}

export function getMemberDetail (parameter) {
  return request({
    url: apis.MemberDetail,
    method: 'get',
    params: parameter
  })
}

export function getCheckList (parameter) {
  return request({
    url: apis.CheckList,
    method: 'get',
    params: parameter
  })
}

export function getStatus (uid) {
  return request({
    url: `${apis.CheckStatus}?uid=${uid}`,
    method: 'get'
  })
}

export function setStatus (data) {
  return request({
    url: `${apis.CheckStatus}?uid=${data.uid}`,
    method: 'post',
    data: data
  })
}

export function checkDetail (uid) {
  return request({
    url: `${apis.CheckDetail}?uid=${uid}`,
    method: 'get'
  })
}

export function settingList (parameter) {
  return request({
    url: apis.SettingList,
    method: 'get',
    params: parameter
  })
}

export function getAddMember () {
  return request({
    url: apis.AddMember,
    method: 'get'
  })
}

export function postAddMember (data) {
  return request({
    url: apis.AddMember,
    method: 'post',
    data: data
  })
}

export function saveResources (data) {
  return request({
    url: apis.SaveResources,
    method: 'post',
    data: data
  })
}

export function saveMonthYj (data) {
  return request({
    url: apis.SaveMonthYj,
    method: 'post',
    data: data
  })
}

export function saveCall (data) {
  return request({
    url: apis.SaveCall,
    method: 'post',
    data: data
  })
}

export function getEditMember (uid) {
  return request({
    url: `${apis.EditMember}?uid=${uid}`,
    method: 'get'
  })
}

export function postEditMember (uid, data) {
  return request({
    url: `${apis.EditMember}?uid=${uid}`,
    method: 'post',
    data: data
  })
}

export function getMemberStatus (uid) {
  return request({
    url: `${apis.EditMemberStatus}?uid=${uid}`,
    method: 'get'
  })
}

export function postMemberStatus (uid, data) {
  return request({
    url: `${apis.EditMemberStatus}?uid=${uid}`,
    method: 'post',
    data: data
  })
}

export function getTransfer (uid) {
  return request({
    url: `${apis.EditTransfer}?old_uid=${uid}`,
    method: 'get'
  })
}

export function postTransfer (uid, data, ctype) {
  return request({
    url: `${apis.EditTransfer}?old_uid=${uid}&ctype=${ctype}`,
    method: 'post',
    data: data
  })
}

export function getBilledList (parameter) {
  return request({
    url: apis.BilledList,
    method: 'get',
    params: parameter
  })
}

export function getMemberView (parameter) {
  return request({
    url: apis.MemberViewList,
    method: 'get',
    params: parameter
  })
}

export function getMemberSetting () {
  return request({
    url: apis.BatchSetting,
    method: 'get'
  })
}

export function postMemberSetting (data) {
  return request({
    url: apis.BatchSetting,
    method: 'post',
    data: data
  })
}

export function getTimeoutMember (parameter) {
  return request({
    url: apis.TimeoutMember,
    method: 'get',
    params: parameter
  })
}

export function getTimeoutCustomer (parameter) {
  return request({
    url: apis.TimeoutCustomer,
    method: 'get',
    params: parameter
  })
}

export function unlockCustomer (uid) {
  return request({
    url: `${apis.CustomerUnlock}?uid=${uid}`,
    method: 'get'
  })
}

export function refresh (uid) {
  return request({
    url: `${apis.TimeoutRefresh}?uid=${uid}`,
    method: 'get'
  })
}

// 组员领取
export function receiveSearch (parameter) {
  return request({
    url: apis.ReceiveSearch,
    method: 'get',
    params: parameter
  })
}

export function receiveType (parameter) {
  return request({
    url: apis.ReceiveData,
    method: 'get',
    params: parameter
  })
}

export function getReceiveData () {
  return request({
    url: `${apis.ReceiveData}?ll=hfs`,
    method: 'get'
  })
}

export function getReceiveOpts () {
  return request({
    url: `${apis.ReceiveSearch}?ll=hfs`,
    method: 'get'
  })
}

export function getMemberReceive (parameter) {
  return request({
    url: apis.MemberReceive,
    method: 'get',
    params: parameter
  })
}
